/**
 * string() 值必须是字符串
 * alphanum() 值只能是包含 a-zA-Z0-9 的字符串
 * min(length) 最小长度
 * max(length) 最大长度
 * required() 值是必填项，不能为 undefined
 * pattern(正则表达式) 值必须符合正则表达式的规则
 */

const joi = require('joi');

const idList = joi.array().required();
const research_field = joi.string().required();
const job_title = joi.string().allow(null, '');
const avatar = joi.string().allow(null, '');
const text = joi.string().required();
const name = joi.string().required();
const id = joi.string().required();


exports.researcher_delete = {
    body:{
        id: idList
    }
}

exports.researcher_insert = {
    body: {
        research_field,
        text,
        job_title,
        avatar,
        name
    }
}

exports.researcher_update = {
    body: {
        research_field,
        text,
        job_title,
        avatar,
        name,
        id
    }
}
